﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AMS.Configuration
{
    /// <summary>
    /// 用于转换的回调参数
    /// </summary>
    public class ConvertCallbackInfo
    {
        /// <summary>
        /// 列的索引
        /// </summary>
        public int ColumnIndex { get; set; }
        /// <summary>
        /// 当前列信息
        /// </summary>
        public ColumnInfo Column { get; set; }
        /// <summary>
        /// 转换的值
        /// </summary>
        public string Value { get; set; }
        /// <summary>
        /// 表示是否转换了新的一行
        /// </summary>
        public bool IsRowChanged { get; set; }

        /// <summary>
        /// 设置相关属性
        /// </summary>
        /// <param name="index"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <param name="isRowChanged"></param>
        public void Set(int index, ColumnInfo column, string value)
        {
            this.ColumnIndex = index;
            this.Column = column;
            this.Value = value;
        }

        /// <summary>
        /// 设置相关属性
        /// </summary>
        /// <param name="index"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <param name="isRowChanged"></param>
        public void Set(int index, ColumnInfo column, string value, bool isRowChanged)
        {
            this.ColumnIndex = index;
            this.Column = column;
            this.Value = value;
            this.IsRowChanged = isRowChanged;
        }
    }
}
